package com.yumijinfu.response;

import com.yumijinfu.entity.BorrowList;

import org.json.JSONArray;
import org.json.JSONObject;

import java.util.ArrayList;

public class HomeIndexRes {
	
    private ArrayList<BorrowList> borrowList;
    
    
	public HomeIndexRes () {
		
	}	
        
    public HomeIndexRes (JSONObject json) {
    

        this.borrowList = new ArrayList<BorrowList>();
        JSONArray arrayBorrowList = json.optJSONArray("borrowList");
        if (null != arrayBorrowList) {
            int borrowListLength = arrayBorrowList.length();
            for (int i = 0; i < borrowListLength; i++) {
                JSONObject item = arrayBorrowList.optJSONObject(i);
                if (null != item) {
                    this.borrowList.add(new BorrowList(item));
                }
            }
        }
        else {
            JSONObject item = json.optJSONObject("borrowList");
            if (null != item) {
                this.borrowList.add(new BorrowList(item));
            }
        }


    }
    
    public ArrayList<BorrowList> getBorrowList() {
        return this.borrowList;
    }

    public void setBorrowList(ArrayList<BorrowList> borrowList) {
        this.borrowList = borrowList;
    }


    
}
